Skip to content

VorbisComments: Support current/total TRACKNUMBER fields#500

Merged
Serial-ATA merged 3 commits intoSerial-ATA:mainfrom
vdualb:main
Jan 11, 2025
Merged

VorbisComments: Support current/total TRACKNUMBER fields#500
Serial-ATA merged 3 commits intoSerial-ATA:mainfrom
vdualb:main

Conversation

@vdualb
Copy link
Contributor

@vdualb vdualb commented Jan 10, 2025

Closes: #499

@vdualb vdualb force-pushed the main branch 2 times, most recently from 6ea135a to 3040351 Compare January 10, 2025 07:19
Copy link
Owner

@Serial-ATA Serial-ATA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Just one suggestion.

value_split.next().and_then(|b| b.parse().ok());
let track_total: Option<u32> =
value_split.next().and_then(|b| b.parse().ok());
if let Some(n) = track_number {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround here also mentions vinyl track numbers. I think in the case that the track number doesn't parse, just insert it into the tag like any other item.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added vinyl track numbers and another test. Also pushing this tag if track number can't be parsed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion! I meant Lofty shouldn't do anything special with vinyl tracks, since I imagine there are weird formats for those out in the wild. In the case that no track number is parsed, just insert it into the tag like normal.

Made that change in e961455 (#500)

@vdualb vdualb force-pushed the main branch 2 times, most recently from 12a16c5 to 4a18f79 Compare January 11, 2025 09:18
Support <current>/<total> and vinyl track number (such as A2, b5) in
TRACKNUMBER field
Closes: Serial-ATA#499
@Serial-ATA Serial-ATA merged commit 909de09 into Serial-ATA:main Jan 11, 2025
@uklotzde
Copy link
Contributor

For these kind of unit tests it is not required to add more test files. The tags to be parsed could be constructed programmatically during the tests and we already use this approach in many cases.

Using actual test files should be reserverd for testing the (binary) deserialization, not the semantic parsing.

@vdualb
Copy link
Contributor Author

vdualb commented Jan 11, 2025

@uklotzde I couldn't immediately figure out how to do that. I will try to change tests later. Could you point to test where tags are constructed programmatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VorbisComments: Support current/total TRACKNUMBER fields

3 participants